package org.timeismoney.payment.service.impl;

import org.timeismoney.payment.model.SchoolYear;
import org.timeismoney.payment.service.ItemStuDetailService;
import org.timeismoney.payment.service.PaymentFinService;
import org.timeismoney.payment.service.PaymentRecordService;
import org.timeismoney.payment.service.SchoolYearService;

public class SchoolYearServiceImpl extends BaseServiceImpl<SchoolYear, Integer> implements SchoolYearService {
	private PaymentRecordService paymentRecordService;
	private PaymentFinService finService;
	private ItemStuDetailService itemStuDetailService;
	
	public void setItemStuDetailService(ItemStuDetailService itemStuDetailService) {
		this.itemStuDetailService = itemStuDetailService;
	}

	public void setFinService(PaymentFinService finService) {
		this.finService = finService;
	}

	public void setPaymentRecordService(PaymentRecordService paymentRecordService) {
		this.paymentRecordService = paymentRecordService;
	}
	
	@Override
	public void delete(SchoolYear e) {
		finService.deleteBySchoolYearNo(e.getSchoolYearNo());
		paymentRecordService.deleteBySchoolYearNo(e.getSchoolYearNo());
		itemStuDetailService.deleteAllBySchoolYearNo(e.getSchoolYearNo());
		super.delete(e);
	}

}
